#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

int stats()
{
  FILE *miredorun;
  int miredopid;
  FILE *gipv62;

  miredorun = fopen("/var/run/miredo.pid", "r");
  if( miredorun == (FILE *)NULL )
    {
      printf("IPV6隧道未运行,");
    }
    else
    {
        fscanf( miredorun, "%d", &miredopid);
        printf("miredo's pid = %d,", miredopid);
        fclose(miredorun);
    }

    gipv62 = fopen( "/tmp/gipv6", "r");
    if( gipv62 == (FILE *)NULL )
    {
        printf("Hosts为基本版");
    }
    else
    {
        printf("Hosts为IPV6版");
        fclose(gipv62);
    }

  return (int)NULL;
}
